//
//  MyCourseView.m
//  BeanSproutEDU
//
//  Created by douya on 15/1/7.
//  Copyright (c) 2015年 douya. All rights reserved.
//

#import "MyCourseView.h"
#import "MyCourseCell.h"
@implementation MyCourseView
-(id)initWithFrame:(CGRect)frame
{
    if ([super initWithFrame:frame])
    {
        UITableView *tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height) style:UITableViewStylePlain];
        tableView.dataSource=self;
        tableView.delegate=self;
        [self addSubview:tableView];
    }
    return self;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
}

-(MyCourseCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *ID=@"cell1";
    MyCourseCell *cell=[tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell)
    {
        NSArray *array=[[NSBundle mainBundle] loadNibNamed:@"MyCourseCell" owner:nil options:nil];
        cell=array[0];
        
    }
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 80;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
